/*
export function queryProductList() {
  return fetch('/api/products').then(res => res.json());
}
*/
// 先用 setTimeout 模拟一个请求，正常的写法如上所示
export function queryProductList(params: { pageSize: number; current: number }) {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve({
        success: true,
        data: [
          {
            id: 1,
            name: 'dva',
          },
          {
            id: 2,
            name: 'antd',
          },
        ]
      });
    }, 2000);
  });
}

export function removeProducts(id: number) {
  return new Promise(resolve => {
    setTimeout(() => {
      console.log('removeAction');
    }, 2000);
  });
};